package com.zhuidian.mothernote.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView.ViewHolder;

import com.base.adapter.BaseRecyclerAdapter;
import com.zhuidian.mothernote.R;
import com.zhuidian.mothernote.bean.QuestionBean;


public class QuestionAdapter extends BaseRecyclerAdapter<QuestionBean> {

    public QuestionAdapter(Context context) {
        super(context);
    }

    @Override
    protected ViewHolder onCreateItemViewHolder(ViewGroup parent) {
        return new MyViewHolder(inflate(R.layout.adapter_question));
    }


    public class MyViewHolder extends ItemViewHolder {
        private TextView tv_title;
        private ImageView iv_headimage;
        private TextView tv_name;
        private TextView tv_content;
        private TextView tv_agreement;
        private TextView tv_comment;
        private ImageView iv_content;

        public MyViewHolder(View view) {
            super(view);
            tv_title = (TextView) view.findViewById(R.id.tv_title);
            iv_headimage = (ImageView) view.findViewById(R.id.iv_headimage);
            tv_name = (TextView) view.findViewById(R.id.tv_name);
            tv_content = (TextView) view.findViewById(R.id.tv_content);
            tv_agreement = (TextView) view.findViewById(R.id.tv_agreement);
            tv_comment = (TextView) view.findViewById(R.id.tv_comment);
            iv_content =(ImageView)  view.findViewById(R.id.iv_content);

        }

        @Override
        protected void setListener(int position) {

        }

        @Override
        protected void initValue(int position, QuestionBean questionBean) {
            tv_name.setText(questionBean.getName());
            tv_content.setText(questionBean.getContent());
            tv_agreement.setText(questionBean.getAgree());
            tv_comment.setText(questionBean.getLike());
            tv_title.setText(questionBean.getTitle());
        }
    }

}


